// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Custom/Metaballs_Lava" {
Properties {    
    _MainTex ("Texture", 2D) = "white" { }    
}
SubShader {
	Tags {"Queue" = "Transparent" }
    Pass 
	{
		Blend SrcAlpha OneMinusSrcAlpha     
		CGPROGRAM
		#include "UnityCG.cginc"
		#pragma vertex vert
		#pragma fragment frag		
		sampler2D _MainTex;	
		struct v2f {
			float4  pos : SV_POSITION;
			float2  uv : TEXCOORD0;
		};	
		float4 _MainTex_ST;		
		v2f vert (appdata_base v){
			v2f o;
			o.pos = UnityObjectToClipPos (v.vertex);
			o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
			return o;
		}	
		
		// Here goes the metaball magic
		//float COLOR_TRESHHOLD=0.2; //To separate and process each color.		
		half4 frag (v2f i) : SV_Target{		
			half4 texcol= tex2D (_MainTex, i.uv); 
			half4 finalColor= texcol;	
			return finalColor;				
			
		}
		ENDCG
    }
}
Fallback "VertexLit"
} 